package lab02.test06;

public class Triangle {
    private double a;
    private double b;
    private double c;
    double grith;
    double area;
    boolean triangle;

    public double Grith(){
        return grith = a+b+c;
    }
//已知三角形三边求面积
    public double Area(){
        return area = 0.25*Math.sqrt((a+b+c)*(a+b-c)*(a+c-b)*(b+c-a));
    }
//判断三角形是否成立
    public boolean Triangles(){
        if((a+b)>c&&(a+c)>b&&(b+c)>a){
            System.out.println("三角形成立");
            return true;
        } else System.out.println("不能构成三角形");
            return false;
    }

    Triangle(){}
    Triangle(double a,double b,double c){
        this.a = a ;
        this.b = b ;
        this.c = c ;
    }

    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }
}
